﻿using Bangle.SerialPort;
using Newtonsoft.Json;
using System;
using System.Threading.Tasks;

namespace Bangle.Abp.SerialPort.ConsoleTestApp.Services
{
    [SerialPort("Default")]
    public class DemoSerialPortService : AbstractAbpSerialPortService
    {
        protected override Task OnDataReceived(byte[] data)
        {
            var text = System.Text.Encoding.ASCII.GetString(data);
            JsonConvert.SerializeObject(text);
            JsonConvert.DeserializeObject("");
            Console.WriteLine("Demo:{0}", text);
            return Task.CompletedTask;
        }
    }
}
